<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../../common/include.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<jsp:include page="../../../common/head.jsp">
			 <jsp:param name="_useTab" value="true"/>
			 <jsp:param name="_useCalendar" value="true"/>
		</jsp:include>

		<title>费用更正</title>
		<script language="JavaScript">
			//费用更正
			function updateData()
			{
				var feeIds = xjCommon.getValueStr("feeId",",");
				if(feeIds.length>0)
				{
					var a = ModalWindow("jump.do?path=updateFeeUpdate.do&updateType=feeReport&feeReportId=${feeReport.feeReportId}&feeIds="+feeIds,800,600);
					if(a=="ok")
						window.location.href = "showDetailFeeUpdate.do?feeReportId=${feeReport.feeReportId}&fromType=fromEdit";
				}
				else
					alert("请选择要更正的费用信息");
			}
			//费用更正历史
			function showHistoryData(feeId)
			{
				ModalWindow("jump.do?path=listHistoryFeeUpdate.do&feeId="+feeId,1000,800);
			}

			//返回
			function goBack()
			{
				window.location.href="listFeeUpdate.do";
			}
			$(document).ready(function()
			{
				//页面从何处调用，直接进入修改或修改数据后重新加载
				var fromType = "${param.fromType}";
				if(fromType=="fromEdit")
					xjTabs.initTab({firstTabSeq:1});
				else
					xjTabs.initTab();
			});
			//查看费用明细
			function showData(feeId)
			{
				ModalWindow("jump.do?path=showFeeDetail.do&feeId="+feeId,800,600);
			}
		</script>
	</head>
	<body>
	<form action="" name="form1" id="form1" method="post">
	<div id="body_div">
	<w:ShowTitle name="费用更正" useSubmitKey="false">
	<w:TitleButton funcName="更正" onClickFunction="updateData()" urlImg="${ctx}/images/main/update.png"/>
	<w:TitleButton funcName="返回" onClickFunction="goBack()" urlImg="${ctx}/images/main/back.png"/>
	</w:ShowTitle>
	<div id="body_content">
		<div class="Sliding_tab">
			<ul>
				<li></li><li><span class="tabsLink" id="setTab0" link="#">费用上报信息</span></li><li></li>
				<li></li><li><span class="tabsLink" id="setTab1" link="#">费用明细</span></li><li></li>
			</ul>
		</div>
		<table width="100%" id="content0" class="tabContent">
            <tr>
              <td width="120" class="right_align">编号</td>
              <td class="left_align">
				${feeReport.feeReportCode}
			  </td>
			 </tr>
            <tr>
              <td width="120" class="right_align">地区</td>
              <td class="left_align">
				${feeReport.areaName}
			  </td>
			 </tr>
			 <tr>
              <td class="right_align"><span class="left_align">事业部</span></td>
              <td class="left_align">
				${feeReport.areaDeptName}
			  </td>
			 </tr>
			<tr>
	              <td class="right_align">经手人</td>
	              <td class="left_align">
	              	${feeReport.createUserName }
	              </td>
			</tr>
			<tr>
	              <td class="right_align">核销月份</td>
	              <td class="left_align">
	              		${feeReport.feeReportYear }${feeReport.feeReportMonth }
	              </td>
			</tr>
			<tr>
	              <td class="right_align">终止日期</td>
	              <td class="left_align">
	              	<fmt:formatDate value='${feeReport.endDate}' pattern="yyyy-MM-dd" />
	              </td>
			</tr>
			<tr>
	              <td class="right_align">票据金额</td>
	              <td class="left_align">
	              	${feeReport.reportBillAmount}
	              </td>
			</tr>
			<tr>
	              <td class="right_align">凭证金额</td>
	              <td class="left_align">
	              	${feeReport.reportCertificateAmount}
	              </td>
			</tr>
            
          </table>
				<table width="100%" id="content1" class="tabContent listTable">
					<tr>
                         <td width="40" class="td_title"><span onclick="xjCommon.checkAll('feeId');">选择</span></td>
                        <td width="150" class="td_title">地区</td>
                        <td class="td_title">事业部</td>
                        <td class="td_title">发生对象</td>
                        <td class="td_title">对象名称</td>
                        <td class="td_title">费用类别</td>
                        <td width="80" class="td_title">登记日期</td>
                        <td width="80" class="td_title">财务主管</td>
                        <td width="80" class="td_title">金额</td>
                        <td width="80" class="td_title">费用日期</td>
                        <td width="100" class="td_title">操作</td>
                      </tr>
					<c:forEach items="${datalist}" var="obj">
						<tr>
							<td><input type="checkbox" name="feeId" value="${obj.feeId}" class="checkbox"/></td>
							<td class="left_align">${obj.areaName}</td>
							<td class="left_align">${obj.areaDeptName}</td>
							<td class="left_align">${obj.feeTarget}</td>
							<td class="left_align">${obj.targetName}</td>
							<td class="left_align">${obj.feeTypeName}</td>
							<td class="left_align"><fmt:formatDate value='${obj.createDate}' pattern="yyyy-MM-dd" /></td>
							<td class="left_align">${obj.financeSupervisorName}</td>
							<td class="left_align">${obj.billAmount+obj.certificateAmount}</td>
							<td class="left_align"><fmt:formatDate value='${obj.feeDate}' pattern="yyyy-MM-dd" /></td>
							<td>
								<a href="#" onclick="javascript:showData('${obj.feeId}')">查看</a>
								<c:if test="${obj.updateState eq '是'}">
								<a href="#" onclick="javascript:showHistoryData('${obj.feeId}')">更正历史</a>
								</c:if>
							</td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</div>	
		</form>
	</body>
</html>